﻿using System;
using UnityEngine;

// Token: 0x020002B6 RID: 694
public class IntStored
{
	// Token: 0x06000FF5 RID: 4085 RVA: 0x0007583F File Offset: 0x00073A3F
	public IntStored(string key, int defaultValue)
	{
		this.key = key;
		this.val = this.GetIntValue(key, defaultValue);
	}

	// Token: 0x1700025D RID: 605
	// (get) Token: 0x06000FF6 RID: 4086 RVA: 0x0007585C File Offset: 0x00073A5C
	// (set) Token: 0x06000FF7 RID: 4087 RVA: 0x00075864 File Offset: 0x00073A64
	public int value
	{
		get
		{
			return this.val;
		}
		set
		{
			this.val = value;
			this.SaveIntValue(this.key, value);
		}
	}

	// Token: 0x06000FF8 RID: 4088 RVA: 0x0007587C File Offset: 0x00073A7C
	private int GetIntValue(string key, int defaultValue)
	{
		if (PlayerPrefs.HasKey(key))
		{
			return PlayerPrefs.GetInt(key);
		}
		return defaultValue;
	}

	// Token: 0x06000FF9 RID: 4089 RVA: 0x0007589E File Offset: 0x00073A9E
	private void SaveIntValue(string key, int newValue)
	{
		PlayerPrefs.SetInt(key, newValue);
	}

	// Token: 0x040014DD RID: 5341
	private string key;

	// Token: 0x040014DE RID: 5342
	private int val;
}
